class Stretch {
  constructor (player) {
    this.player = player
    this.setStretch()
  }

  setStretch () {
    const {stretching} = this.player._config
    let objectFit

    if (stretching === 'uniform') {
      objectFit = 'contain'
    }
    if (stretching === 'exactfit') {
      objectFit = 'fill'
    }
    if (stretching === 'fill') {
      objectFit = 'cover'
    }
    if (stretching === 'none') {
      objectFit = 'none'
    }
    this.player.dom.video.style.objectFit = objectFit || stretching
  }
}

export default Stretch
